<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
    <input id="scheme_id" class="form-control" name="scheme_id" type="hidden" value="{$scheme_id}">
    <div class="layui-form-item">
        <label class="layui-form-label">字段代码</label>
        <div class="layui-input-block">
            <input type="text" id="flowcode" name="fieldcode" required placeholder="复选框后缀:默认为set类型(与fastadmin生成规则相同)" autocomplete="off"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">字段名称</label>
        <div class="layui-input-block">
            <input type="text" id="flowname" name="fieldname" required placeholder="请输入字段名称" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">字段类型</label>
        <div class="layui-input-block">
            <select id="c-type" name="type" lay-verify="required" lay-search="">
                <option value="varchar(255)">varchar(字符串)</option>
                <option value="mediumtext">mediumtext(长文本)</option>
                <option value="int">int(数字)</option>
                <option value="datetime">datetime(时间)</option>
                <option value="enum">enum(枚举单)</option>
                <option value="set">set(枚举多)</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">默认值</label>
        <div class="layui-input-block">
            <input type="text" id="default" name="default" required placeholder="set,enum类型默认值以逗号隔开" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-back-submit" id="LAY-user-back-submit" value="确认">
    </div>
</div>

<script src="/static/admin/layui/layui.js"></script>
<script src="/static/admin/js/xm-select.js"></script>
<script>
    layui.config({
        base: '/static/admin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
        treeTable: '../admin/lib/extend/authtree'
    }).use(['index', 'form', 'laydate'], function () {
        var $ = layui.$, form = layui.form, laydate = layui.laydate;

        $.ajax({
            url: "{:url('flow/adminTree')}",
            type: 'post',
            dataType: 'json',
            success: function (res) {
                xmSelect.render({
                    el: '#demo1',
                    filterable: true,
                    data: res
                })
            }
        });
        form.render();
    });
</script>
